// 导入axios实例
import request from "@/utils/request";

// 根据业务要求- 查接口文档-封装api
/**
 * 获取所有角色信息
 * @param {*} params  {page, pagesize}
 * @returns
 */
export function getRoles(params) {
  return request({
    url: "/api/sys/role",
    method: "get",
    params: params,
  });
}
export function delRoles(id) {
  return request({
    url: '/api/sys/role/' + id,
    method: "delete",
  });
}
//添加
export function addRole(data) {
  return request({
    url: "/api/sys/role",
    method: "post",
    data,
  });
}

//编辑
export function editRole(data) {
  return request({
    url: "/api/sys/role/" + data.id,
    method: "put",
    data,
  });
}